/***************************************************************************
 *   Copyright (C) 2009 by pawel   *
 *   pawel@byszewski.pl   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef RECODR_H
#define RECODR_H

#include <string>
#include "tuple.h"
#include "recdes.h"
#include "command.h"
#include "settings.h"
#include <fstream>
#include <iostream>
/**
	@author pawel <pawel@byszewski.pl>
*/
class Record : public Tuple, public RecordDescriptor
{
public:
	Record( RecordDescriptor *des, Tuple *krot){
		setBooked(des->getBooked());
		setOfset(des->getOfset());
		setSize(des->getSize());
		for(int i=0; i<ELEMENTCOUNT; ++i){
			setType(i, (des->getType())[i]);
		}
		ints=krot->ints;
		floats=krot->floats;
		strings=krot->strings;
	}
    Record()
    {
    };
    	void setFromComIn(Command *c){
		size=Tuple::setFromCom(c);
		for(int i =0; i<ELEMENTCOUNT;++i)
			RecordDescriptor::type[i]=c->type[i];
		//Krotka::wypisz();
		
	};
     char * createDesBuf(){
	     char *buf=new char[DESLENGTH];
	     buf=RecordDescriptor::createBuf();
	     return buf; 
     }
     char * createKrotBuf(char *type, int size)
     {
	     char *buf=new char[size];
	     buf=Tuple::createBuf(type,size);
	     return buf;
     }
  	void wypiszKrotToFile(std::ofstream stream){
  		;//Tuple::wypiszToFile(stream);
  	}
    ~Record(){};

};

#endif
